package org.tissou.server.Operations;

import org.tissou.client.Services.Parametres;
import org.tissou.client.Services.OperationFactoryInfos;

/**
 * Created by IntelliJ IDEA.
 * User: Claire
 * Date: 11-Jan-2009
 * Time: 14:28:02
 * To change this template use File | Settings | File Templates.
 */
public class OperationFactory {



  public static Operation CreerOperation(Parametres parametres) {
    OperationFactoryInfos.TypeOperation typeOperation = parametres.getTypeoperation();
    switch (typeOperation) {
      case OPERATION_DEPENSE :
        return Operation_Depense.ConstruireAvecParametres(parametres);

      case OPERATION_RECETTE:
        return Operation_Recette.ConstruireAvecParametres(parametres);

      case OPERATION_PRET:
        return Operation_Pret.ConstruireAvecParametres(parametres);

      case OPERATION_REMBOURSEMENT:
        return Operation_Remboursement.ConstruireAvecParametres(parametres);

      case OPERATION_TRANSFERTMONNAIEDETTE:
        return Operation_TransfertMonnaie_Dette.ConstruireAvecParametres(parametres);

      case OPERATION_TRANSFERTMONNAIEPERSONNEL:
        return Operation_TransfertMonnaie_Personnel.ConstruireAvecParametres(parametres);

      case OPERATION_VIREMENTINTERNE:
        return Operation_VirInterne.ConstruireAvecParametres(parametres);
      default:
        return null;
  }
  }
}
